#ifndef SKETCHMODELWRAPPER_H_
#define SKETCHMODELWRAPPER_H_
#include <QtCore/QObject>
#include <map>
#include <list>
#include <string>
#include "common/SketchModel.h"

using namespace common;

class SketchModelWrapper:public QObject {
	Q_OBJECT

	SketchModel* model;

public:
	SketchModelWrapper(QObject *parent = 0);
	virtual ~SketchModelWrapper();
public slots:

	void solve();
	void relax();
	// segments slots
	void addLine(Coordinate c1,Coordinate c2);
	void addCircle(Coordinate c1,Coordinate c2);
	void addSegment(std::list<Coordinate> cSet);

	void pointAdjust(int i, Coordinate c1);

	// constraint slots
	void addConnectPoints(int k,int l);
	void addFixPoint(int k);
	void addPerpendicular(int k,int l, int m,int n);
	void addHorizontal(int k,int l);
	void addVertical(int k,int l);
	void addParallel(int k,int l, int m,int n);
	void addSameLength(int k,int l, int m,int n);
	void addDistance(int k,int l,skreal paramValue);
	void addAngle(int k,int l,int m,int n,skreal paramValue);
	void addTangency(int k,int l,int m,int n);

	// TABLE SLOT
	void removeConstraint(int id);
	void removePrimitive(int id);
	void setParameter(int id,skreal value);

	// TABLE DATA
	std::map<int,std::string> getPrimitiveData();
	std::list<ConstraintData> getConstraintData();
	std::map<int,skreal> getParameterData();

	// GRAPHICS VIEW + above getPrimitiveData()
	std::map<int,Coordinate> getPrimitivePoints(int i);
	std::list<std::string> getMessages();

signals:

	void viewChanged();
	void modelSolved();
	void tablePrimitiveChanged();
	void tableConstraintChanged();
	void tableParameterChanged();

};

#endif /* SKETCHMODELWRAPPER_H_ */
